package com.konsung.ksdc.bean.netbean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 注册信息bean
 * Created by Administrator on 2016/3/17 0017.
 */
public class RegisterEmpNetBean implements Parcelable {
    private String id;  // 服务器自动添加

    protected String empName; // 姓名

    protected String available; // "Y"

    protected String telphone; // 电话

    protected String dockingTime; // 注册时间

    protected String addr; // 地址

    protected String empFlag = "1"; // 用户类型

    private RegisterUserNetBean user;

    /**
     * 构造方法
     * @param empName 姓名
     * @param telphone 电话
     * @param addr 家庭地址
     * @param user 账号信息bean
     */
    public RegisterEmpNetBean(String empName, String telphone, String addr,
            RegisterUserNetBean user) {
        this.id = null;
        this.empName = empName;
        this.available = "Y";
        this.telphone = telphone;
        this.dockingTime = null;
        this.addr = addr;
        this.empFlag = "1";
        this.user = user;
    }

    /**
     * 获取注册id
     * @return 注册id
     */
    public String getId() {
        return id;
    }

    /**
     * 设置注册id
     * @param id 注册id
     */
    public void setId(String id) {
        this.id = id;
    }

    /**
     * 获取账户名
     * @return 账户名
     */
    public String getEmpName() {
        return empName;
    }

    /**
     * 设置账户名
     * @param empName 账户名
     */
    public void setEmpName(String empName) {
        this.empName = empName;
    }

    /**
     * 获取账号是否可用
     * @return 账号是否可用 "Y"代表可用
     */
    public String getAvailable() {
        return available;
    }

    /**
     * 设置账号可用性
     * @param available 账号是否可用 "Y"代表可用
     */
    public void setAvailable(String available) {
        this.available = available;
    }

    /**
     * 获取联系电话
     * @return 联系电话
     */
    public String getTelphone() {
        return telphone;
    }

    /**
     * 设置联系电话
     * @param telphone 联系电话
     */
    public void setTelphone(String telphone) {
        this.telphone = telphone;
    }

    /**
     * 获取注册时间
     * @return 注册时间
     */
    public String getDockingTime() {
        return dockingTime;
    }

    /**
     * 设置注册时间
     * @param dockingTime 注册时间
     */
    public void setDockingTime(String dockingTime) {
        this.dockingTime = dockingTime;
    }

    /**
     * 获取家庭地址
     * @return 家庭地址
     */
    public String getAddr() {
        return addr;
    }

    /**
     * 设置家庭地址
     * @param addr 家庭地址
     */
    public void setAddr(String addr) {
        this.addr = addr;
    }

    /**
     * 获取用户类型
     * @return 用户类型
     */
    public String getEmpFlag() {
        return empFlag;
    }

    /**
     * 设置用户类型
     * @param empFlag 用户类型
     */
    public void setEmpFlag(String empFlag) {
        this.empFlag = empFlag;
    }

    /**
     * 获取账户信息Bean
     * @return 账户信息Bean
     */
    public RegisterUserNetBean getUser() {
        return user;
    }

    /**
     * 设置账户信息Bean
     * @param user 账户信息Bean
     */
    public void setUser(RegisterUserNetBean user) {
        this.user = user;
    }

    @Override
    public String toString() {
        return "RegisterEmpNetBean{" +
                "id='" + id + '\'' +
                ", empName='" + empName + '\'' +
                ", available='" + available + '\'' +
                ", telphone='" + telphone + '\'' +
                ", dockingTime=" + dockingTime +
                ", addr='" + addr + '\'' +
                ", empFlag='" + empFlag + '\'' +
                ", user=" + user +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.id);
        dest.writeString(this.empName);
        dest.writeString(this.available);
        dest.writeString(this.telphone);
        dest.writeString(this.dockingTime);
        dest.writeString(this.addr);
        dest.writeString(this.empFlag);
        dest.writeParcelable(this.user, flags);
    }

    /**
     * 序列化实体类对象
     * @param in Parcel对象
     */
    protected RegisterEmpNetBean(Parcel in) {
        this.id = in.readString();
        this.empName = in.readString();
        this.available = in.readString();
        this.telphone = in.readString();
        this.dockingTime = in.readString();
        this.addr = in.readString();
        this.empFlag = in.readString();
        this.user = in.readParcelable(RegisterUserNetBean.class
                .getClassLoader());
    }

    public static final Creator<RegisterEmpNetBean> CREATOR = new
            Creator<RegisterEmpNetBean>() {
                @Override
                public RegisterEmpNetBean createFromParcel(Parcel source) {
                    return new RegisterEmpNetBean(source);
                }

                @Override
                public RegisterEmpNetBean[] newArray(int size) {
                    return new RegisterEmpNetBean[size];
                }
            };
}
